#include("../../comm/ListHead.html")
<link rel="stylesheet" href="../../static/plugins/wxmenu/css/menu.css?v=1.355" media="all">
<link rel="stylesheet" href="../../static/plugins/font-awesome-4.7.0/css/font-awesome.min.css?v=1.355" media="all">
<div class="layui-fluid layui-anim layui-anim-fadein">
    <div class="wx-card">
        <div class="wx-box">
            <div class="wx-head">微信公众号</div>
            <div class="wx-body">
                <p class="content-tips">内容区域</p>

                <div class="wx-footer">
                    <li class="add-menu"><i class="fa fa-plus"></i></li>
                </div>
            </div>
        </div>
        <div class="wx-editor">
            <a href="javascript:;" class="editor-load"><i class="fa fa-spinner"></i></a>
            <span class="editor-tips">请点击左侧菜单</span>

            <div class="wx-editor-show">
                <div class="wx-editor-head">菜单一<a class="menu-delete">删除该菜单</a></div>
                <div class="wx-editor-body">
                    <div class="cjb-form-group">
                        <label>菜单名称:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="cjb-name" placeholder="菜单名称">
                        </div>
                    </div>
                    <div class="cjb-form-group cjb-radio-group">
                        <label>菜单类型:</label>

                        <div class="cjb-input-block">
                            <li class="cjb-radio select" type="view">跳转链接</li>
                            <li class="cjb-radio" type="click">发送消息</li>
                            <li class="cjb-radio" type="miniprogram">跳小程序</li>
                        </div>
                    </div>
                    <div class="cjb-form-group cjb-val-group type-view">
                        <label for="">链接地址:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="view-val" placeholder="链接地址">

                            <p class="cjb-input-tips">请输入包含http://或者https://的完整链接</p>
                        </div>
                    </div>
                    <div class="cjb-form-group cjb-val-group type-click">
                        <label for="">消息内容:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="click-val" placeholder="消息内容">

                            <p class="cjb-input-tips">用户点击时自动回复的内容</p>
                        </div>
                    </div>
                    <div class="cjb-form-group cjb-val-group type-miniprogram">
                        <label for="">AppID:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="app-id" placeholder="AppID">

                            <p class="cjb-input-tips">请输入AppID</p>
                        </div>
                        <label for="">App Path:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="app-path" placeholder="App Path">

                            <p class="cjb-input-tips">请输入App Path</p>
                        </div>
                        <label for="">URL:</label>

                        <div class="cjb-input-block">
                            <input type="text" class="cjb-input" name="app-url" placeholder="地址">

                            <p class="cjb-input-tips">请输入地址</p>
                        </div>
                    </div>
                    <div class="cjb-form-group">
                        <div class="cjb-input-block">
                            <a class="set_menu fluid-btn">确认修改</a>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <form action="" class="layui-form" lay-filter="form">
        #(token??)
        <p style="text-align: center;height:50px;line-height:50px;">
            <button type="submit" class="layui-btn layui-btn-sm btn-change-13" lay-submit="" lay-filter="Save">保存菜单</button>
            <button type="submit" class="layui-btn layui-btn-sm btn-change-5" lay-submit="" lay-filter="Submit">提交菜单</button>
            <button type="reset" class="layui-btn layui-btn-sm" lay-active="reload">重置</button>
        </p>
        <textarea style="display:none" id="wx_menu">#(form.data.wx_menu)</textarea>
    </form>
</div>
</div>
<script language="JavaScript" src="../../static/js/jquery-3.5.1.js?v=#(time)"></script>
<script language="JavaScript" src="../../static/plugins/wxmenu/js/menu.js?v=#(time)"></script>
<script language="JavaScript">
    var wx_menu = $("#wx_menu").val();
    if (wx_menu != '') {
        var data = eval('(' + $("#wx_menu").val() + ')');
        setMenuList(data);
    }


    layui.use(['form', 'myTool'], function () {
        var form = layui.form;
        var $ = layui.$;
        form.on('submit(Save)', function (data) {
            data.field.menu = JSON.stringify(getMenuList(), null, '    ');
            layui.myTool.postJson("ModifyWxMenuDataApi", data.field, function () {
                top.layer.closeAll();
            });
            return false;
        });
        form.on('submit(Submit)', function (data) {
            data.field.menu = JSON.stringify(getMenuList(), null, '    ');
            data.field.action = "submit";
            layui.myTool.postJson("ModifyWxMenuDataApi", data.field, function () {
                top.layer.closeAll();
            });
            return false;
        });
    });
</script>

#include("../../comm/Foot.html")